/*
 * Copyright (C) 2011 bus.fm
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.busfm.media;

import com.busfm.model.PlayList;

/**
 * <p>
 * Title:PlayController
 * </p>
 * <p>
 * Description:PlayController
 * </p>
 * <p>
 * Copyright (c) 2011 www.bus.fm Inc. All rights reserved.
 * </p>
 * <p>
 * Company: bus.fm
 * </p>
 * 
 * 
 * @author jingguo0@gmail.com
 * 
 */
public interface PlayController {

    /**
     * Opens playlist
     * 
     * @param playlist
     */
    public void setPlaylist(PlayList playlist);

    /**
     * Gets currently opened playlist
     * 
     * @return <code>PlayList</code> instance or <code>null</code>
     */
    public PlayList getPlaylist();

    /**
     * Start playing
     */
    public void play();

    /**
     * Checks whether player is playing or not
     * 
     * @return boolean value
     */
    public boolean isPlaying();

    /**
     * Stop playing
     */
    public void stop();

    /**
     * Pause playing
     */
    public void pause();

    /**
     * Jump to the next song on the playlist
     */
    public void next();

    /**
     * Jump to the previous song on the playlist
     */
    public void prev();

    /**
     * Skip to the track on the playlist s
     * 
     * @param index
     *            Track number on the playlist
     */
    public void skipTo(int index);

    /**
     * Set events listener
     * 
     * @param playerEngineListener
     */
    public void setListener(PlayControllerListener playerEngineListener);
}
